package com.logistics.erp.entity.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.logistics.erp.entity.model.ErpInvBillSave;
import com.logistics.utils.tool.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * ERP领料单
 * </p>
 *
 * @author kaihan.wang
 * @since 2024-07-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("lgs_erp_invbill")
public class ErpInvbill implements Serializable {

      private static final long serialVersionUID = 1L;

      @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      //ERP领料单号
      private String erpInvbillCode;

      private String erpInvbillType;

      //优先级
      private Integer priority;

      //班组编号
      private String wcCode;

      //班组名称
      private String wcName;

      //部门编号
      private String deptCode;

      //部门名称
      private String deptName;

      // 结束点
      private String endLocation;

      //配送终点描述
      private String endLocationName;

      //缺料状态（1:不缺料,0:缺料）
      private Integer lackMaterialStatus;

      // 区域
      private String locationArea;

      //创建人组织编码
      private String createOrgCode;

      //创建人部门编码
      private String createDepCode;

      //创建人
      private String creator;

      //创建时间
      private Date createTime;

      //修改人
      private String updater;

      //修改时间
      private Date updateTime;


      public static ErpInvbill build(ErpInvBillSave save){
        ErpInvbill erpInvbill = new ErpInvbill();
        erpInvbill.setErpInvbillCode(save.getErpInvBillCode());
        erpInvbill.setPriority(save.getPriority());
        erpInvbill.setWcCode(save.getWcCode());
        erpInvbill.setWcName(save.getWcName());
        erpInvbill.setEndLocation(save.getEndLocation());
        erpInvbill.setEndLocationName(save.getEndLocationName());
        erpInvbill.setDeptCode(save.getDeptCode());
        erpInvbill.setDeptName(save.getDeptName());
        erpInvbill.setLackMaterialStatus(save.getLackMaterialStatus());
        erpInvbill.setLocationArea(save.getLocationArea());
        erpInvbill.setCreateOrgCode(save.getCreateOrgCode());
        erpInvbill.setCreateDepCode(save.getCreateDepCode());
        erpInvbill.setErpInvbillType(save.getErpInvBillType());
        erpInvbill.setCreator(save.getCreator());
        erpInvbill.setCreateTime(DateUtils.stringToDateFormat(save.getCreateTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
        erpInvbill.setUpdater(save.getUpdater());
        erpInvbill.setUpdateTime(DateUtils.stringToDateFormat(save.getUpdateTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
        return erpInvbill;
      }

      public static ErpInvbill build(Integer lackMaterialStatus){
          ErpInvbill erpInvbill = new ErpInvbill();
          erpInvbill.setLackMaterialStatus(lackMaterialStatus);
          return erpInvbill;
      }

}
